home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / mail / aemail143 / install_aemail < prev    next >
Text File  |  1998-05-24  |  44KB  |  1,169 lines

  1. ;**
  2. ;** Install_AEMail - AEMail installation script for Installer
  3. ;**
  4. ;** Copyright (c) 1996-1998 John F. Zacharias
  5. ;**                    All rights reserved.
  6. ;**
  7. ;** This script has been tested with Installer 43.3 which is included with
  8. ;** this archive:
  9. ;**
  10. ;**     Installer and Installer project icon
  11. ;**     (c) Copyright 1995-96 Escom AG.  All Rights Reserved.
  12. ;**     Reproduced and distributed under license from Escom AG.
  13. ;**
  14. ;**     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  15. ;**     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  16. ;**     OR RESPONSIBILITY IS ASSUMED.
  17. ;**
  18. ;** Use following Icon tooltypes / Command line options:
  19. ;**
  20. ;** APPNAME=AEMail
  21. ;** MINUSER=NOVICE
  22. ;**
  23. ;**
  24. ;** Installer script modified on 01/15/98 for AEMail Version 1.43
  25.  
  26. (set
  27.  ;;
  28.  ;; The source directory name
  29.  ;;
  30.  source-dir (if (= 1 (exists @icon))
  31.             (pathonly (expandpath @icon))
  32.             (expandpath @icon)))
  33.  
  34. (set version_3_0 39)  
  35.  
  36. (set aem-vernum (getversion (tackon source-dir "AEMail")))
  37. (set
  38.     aem-vernew (/ aem-vernum 65536)
  39.     aem-revnew (- aem-vernum (* aem-vernew 65536)))
  40.  
  41. (set exec-version (/ (getversion) 65536))
  42. (set avail-mem (+ (database "total-mem")))
  43. (set system-cpu (database "cpu"))
  44.  
  45. (set full-aem-name "AEMail Beta Version 1.30")
  46.  
  47. (set
  48.     aem-name "AEMail"
  49.     aem-assign (cat aem-name ":")
  50.     aem-Termite 0
  51.     )
  52.  
  53. (if (= 1 (exists "ENV:TermiteTCP.prefs" (noreq)))
  54.          (set aem-Termite 1)
  55.          (set aem-Termite 0))
  56.  
  57. (if (= 2 (exists "AMITCP:bin" (noreq)))
  58.     (set aem-have-AMITCP 1)
  59.     (set aem-have-AMITCP 0))
  60.  
  61. (if (= 2 (exists "Miami:" (noreq)))
  62.     (set aem-have-MIAMI 1)
  63.     (set aem-have-MIAMI 0))
  64.  
  65. (if (= 1 (exists "ENV:AEMail_Dir" (noreq)))
  66.     (set @default-dest (getenv ("AEMail_Dir")))
  67.     (set @default-dest
  68.         (if (= 1 aem-have-AMITCP)
  69.             (expandpath "AMITCP:bin")
  70.             (@default-dest))))
  71.  
  72. (if (= "AEMail" (fileonly @default-dest))
  73.     (set @default-dest (pathonly @default-dest)))
  74.  
  75.  
  76. (if (= 2 @user-level)
  77.  
  78.     (set
  79.     ;;
  80.     ;; Sets up where to place AEMail program
  81.     ;;
  82.     @default-dest
  83.         (askdir
  84.             (prompt "Enter the drawer in which you want AEMail installed\n"
  85.                     "A drawer called AEMail will be created "
  86.                     "if it does not already exist (except if AmiTCP:bin is "
  87.                     "specified)")
  88.             (help   "If you are using AmiTCP, AEMail should be installed in "
  89.                     "'AmiTCP:bin'\n\n"
  90.                     "However, you may install it anywhere you like\n\n"
  91.                     "If it is not 'AmiTCP:bin' a drawer called 'AEMail' "
  92.                     "will be created.\n")
  93.             (default @default-dest)
  94.             (newpath))))
  95.  
  96. (if (= 1 aem-have-AMITCP)
  97.     (if (<> @default-dest (expandpath "AMITCP:bin"))
  98.         (set aem-have-AMITCP 0)))
  99.  
  100. ; (if (= "AEMail" (fileonly @default-dest))
  101. ;     (set @default-dest (pathonly @default-dest)))
  102.  
  103. (if (= 0 aem-have-AMITCP)
  104.     (set @default-dest (tackon @default-dest "AEMail")))
  105.  
  106. (if (= 0 (exists @default-dest (noreq)))
  107.     ((makedir @default-dest (infos))
  108.      (onerror ((delete @default-dest
  109.                 (prompt "Deleting AEMail directory")
  110.                 (help "Deleting AEMail directory")
  111.                 (optional "force")
  112.                 (safe)
  113.                 (all)
  114.                 (infos))
  115.               (delete "RAM:AEMfiles"
  116.                 (prompt "Deleting RAM: AEMail files")
  117.                 (optional "force")
  118.                 (safe)
  119.                 (all)
  120.                 (infos))))))
  121.  
  122. (if (= 1 (exists @default-dest (noreq)))
  123.     (set @default-dest (pathonly @default-dest)))
  124.  
  125. (set aem-default-dest @default-dest)
  126.  
  127. (set
  128.  ;;
  129.  ;; The default Mail directory
  130.  ;;
  131.     aem-change-name 0
  132.  
  133.     atcp-dir (if (= 1 aem-have-AMITCP)
  134.         (expandpath "AMITCP:")
  135.         (@default-dest))
  136.  
  137.     aem-dft-maildir (if (= 2 (exists aem-assign (noreq)))
  138.         (pathonly(getassign aem-name))
  139.         (atcp-dir))
  140.  
  141.     aem-mail-name (if (= 2 (exists aem-assign (noreq)))
  142.         (fileonly(getassign aem-name))
  143.         (""))
  144.   )
  145.  
  146.  
  147. (if (<> "" aem-mail-name)
  148.     (if (<> "AEMail_Mail" aem-mail-name)
  149.         ((set
  150.             aem-change-name
  151.                 (askbool
  152.                     (prompt "Your AEMAIL: assignment is for:\n\n"
  153.                             (getassign aem-name) "\n\n"
  154.                             "This directory is not named \"AEMail_Mail\"\n\n"
  155.                             "Do you want to change the directory's name to "
  156.                             "\"AEMail_Mail\" and use it as your AEMAIL: directory?")
  157.                     (help   "This install script automatically uses an AEMAIL: "
  158.                             "assignment name of \"AEMail_Mail\".  If you reply NO "
  159.                             "to this request your existing AEMAIL: directory "
  160.                             "will NOT be used as your mail directory\n")
  161.                     (default 1))))))
  162.  
  163. (if (= 1 aem-change-name)
  164.  
  165.     ((rename (tackon aem-dft-maildir aem-mail-name)
  166.             (tackon aem-dft-maildir "AEMail_Mail")
  167.             (prompt "Relabeling AEMAIL: directory")
  168.             (help   "Relabeling AEMAIL: directory"))
  169.     (rename (tackon aem-dft-maildir ("%s.info" aem-mail-name))
  170.             (tackon aem-dft-maildir "AEMail_Mail.info")
  171.             (prompt "Relabeling AEMAIL: directory .info")
  172.             (help   "Relabeling AEMAIL: directory .info")))
  173. )
  174.  
  175. (set
  176.     aem-mail-dir (aem-dft-maildir))
  177.  
  178. (if (= 2 @user-level)
  179.  
  180.     (set
  181.         aem-mail-dir
  182.             (askdir
  183.                 (prompt "Enter the drawer in which you want your mail placed.  "
  184.                     "A drawer called 'AEMail_Mail' will be created in this "
  185.                     "drawer (if it does not already exist) and AEMAIL: will be "
  186.                     "assigned to 'AEMail_Mail'")
  187.                 (help   "All of your mail and configuration files will be stored "
  188.                     "in the 'AEMail_Mail' sub-directory of this drawer.  An assign "
  189.                     "statement will be assigned to the 'AEMail_Mail' sub-directory to 'AEMAIL:' "
  190.                     "and will be placed in your 'S:User-Startup' script.\n\n"
  191.                     "The directory your specify here will be created if it does "
  192.                     "not exist\b")
  193.                 (default aem-dft-maildir)
  194.                 (newpath))))
  195.  
  196.  
  197. (if (= "AEMail_Mail" (fileonly aem-mail-dir))
  198.     (set aem-mail-dir (pathonly aem-mail-dir)))
  199.  
  200. (set aem-mail-dir (tackon aem-mail-dir "AEMail_Mail"))
  201.  
  202. ; Use ENV:PAGER program, Multiview, or copy "More" to RAM: for use
  203.  
  204. (set
  205.  pager-cmd (if (exists "ENV:PAGER" (noreq)) (getenv "PAGER"))
  206.  pager-cmd
  207.     (if pager-cmd pager-cmd
  208.         (if (= 1 (exists "SYS:Utilities/Multiview" (noreq)))
  209.             ("SYS:Utilities/Multiview")
  210.             ((copyfiles
  211.                 (prompt "Copying " (tackon source-dir "c/More") " to RAM: for use")
  212.                 (source (tackon source-dir "c/More"))
  213.                 (dest   "RAM:")
  214.                 (safe)
  215.                 (optional "nofail"))
  216.                 "RAM:More"))))
  217.  
  218. (makedir "RAM:AEMfiles")
  219.  
  220. (copyfiles
  221.     (prompt "Copying AEMail.readme to RAM:")
  222.     (source (tackon source-dir "AEMail.readme"))
  223.     (dest   "RAM:AEMfiles")
  224.     (infos))
  225.  
  226. (copyfiles
  227.     (prompt "Copying LHA to RAM:")
  228.     (source (tackon source-dir "c/LHex"))
  229.     (dest   "RAM:"))
  230.  
  231. (set
  232.     doc-files (tackon source-dir "files.lha"))
  233.  
  234. (set
  235.     doc-files ("\"%s\"" doc-files))
  236.  
  237. (message "\n\nSelect PROCEED to decompress the AEMail files to RAM\n\n"
  238.     "Be patient, this will take a while\n\n"
  239.     "If you are installing from diskette, the decompression "
  240.     "will take approx 3 minutes\n\n"
  241.     "From your hard drive, the decompression will take approx 20 seconds")
  242.  
  243. (set aem-lha
  244.     (run "RAM:lhex -fwRAM:AEMfiles x " doc-files " >NIL:" (safe)))
  245.  
  246. (if (< exec-version version_3_0)
  247.     (tooltype
  248.         (dest "RAM:AEMfiles/AEMail.guide")
  249.         (setdefaulttool "AmigaGuide"))
  250.     (tooltype
  251.         (dest "RAM:AEMfiles/AEMail.guide")
  252.         (setdefaulttool "MultiView")))
  253.  
  254. (delete 
  255.     "RAM:lhex"
  256.     (prompt "Deleting RAM:lha file")
  257.     (optional "force")
  258.     (safe))
  259.  
  260. (set
  261.     aem-configure 0
  262.     aem-interlace 0
  263.     aem-needconfig 0
  264.     aem-options 3
  265.     aem-config ""
  266.     aem-username ""
  267.     aem-password ""
  268.     aem-from ""
  269.     aem-replyto ""
  270.     aem-organization ""
  271.     aem-realname ""
  272.     aem-domain ""
  273.     aem-popserver ""
  274.     aem-smtpserver ""
  275.     aem-editor ""
  276.     aem-startnet ""
  277.     aem-stopnet ""
  278.     aem-need-AREXX 0
  279.     aem-needstrtarexx 0
  280.     aem-needstoparexx 0)
  281.  
  282. (if (= 1 aem-have-MIAMI)
  283.     (set
  284.         aem-need-AREXX 1
  285.         aem-needstrtarexx 1
  286.         aem-startnet (tackon aem-default-dest "startnet.miami")
  287.         aem-needstoparexx 1
  288.         aem-stopnet  (tackon aem-default-dest "stopnet.miami"))
  289.     (if (= 1 aem-have-AMITCP)
  290.         (set
  291.             aem-need-AREXX 1
  292.             aem-startnet (tackon aem-default-dest "startnet")
  293.             aem-stopnet (tackon aem-default-dest "stopnet"))))
  294.  
  295. (if (= 1 aem-Termite)
  296.     ((set
  297.         aem-from (getenv "ttcp-email-address")
  298.         aem-tccp-len (strlen aem-from)
  299.         aem-tccp-cnt 0)
  300.  
  301.      (while (<> aem-tccp-cnt aem-tccp-len)
  302.             (if (= "@" (substr aem-from aem-tccp-cnt 1))
  303.                 (set
  304.                     aem-username
  305.                         (substr aem-from 0 aem-tccp-cnt)
  306.                     aem-tccp-cnt (+ 1 aem-tccp-cnt)
  307.                     aem-domain
  308.                         (substr aem-from aem-tccp-cnt))
  309.                 (set
  310.                     aem-tccp-cnt (+ 1 aem-tccp-cnt))))))
  311.  
  312.  
  313. (if (< 0 @user-level)
  314. (if (<> 1 (exists "s:aemail.cnfg" (noreq)))
  315. (set
  316.     aem-configure
  317.         (askbool
  318.             (prompt "\nYou can configure AEMail now or you can wait until "
  319.                     "AEMail is first loaded.  Do you want to configure now?\n")
  320.             (help   "AEMail is configured either by Tool Types in it's icon "
  321.                     "or by a configuration screen which is automatically "
  322.                     "called up when you first execute AEMail if the Tool "
  323.                     "Type parameters were not given.  By replying "
  324.                     "'Yes, Configure Now' you will be setting the Tool Type "
  325.                     "parameters\n")
  326.             (choices "No, Configure Later" "Yes, Configure Now"))
  327.     )
  328. (set
  329.     aem-configure
  330.         (askbool
  331.             (prompt "\nYou have an existing configuration file.\n\n"
  332.                     "Do you want to use it or do you want to re-configure "
  333.                     "AEMail now?\n")
  334.             (help   "By replying 'Yes, Re-configure Now' "
  335.                     "you will be renaming the current configuration file "
  336.                     "to 's:aemail.cnfg.old' "
  337.                     "and resetting the configuration by tool type "
  338.                     "parameters\n")
  339.             (choices "Use existing Config File" "Yes, Re-Configure Now")))
  340. )
  341. )
  342.  
  343. (if (= 0 aem-configure)
  344.     ((rename "s:aemail.cnfg" "s:aemail.cnfg.old"
  345.             (prompt "Renaming old s:aemail.cnfg file"))
  346.     (set aem-interlace
  347.         (askbool
  348.             (prompt "\n\nDo you want to open AEMail on an interlaced screen?")
  349.             (help   "Replying 'YES' will place the Tool Type 'INTERLACE=YES' "
  350.                     "in your AEMail icon.  This will open AEMail on an "
  351.                     "interlaced screen when it is executed.\n")))
  352.  
  353.     (Set continue 0)
  354.  
  355.     (message "\n\nWe need to know something about your Internet provider and what "
  356.         "the POP and SMTP Servers on your provider's machine are called.  "
  357.         "Also, when you signed up for your InterNet service you chose or "
  358.         "were given a login name and password for your POP server. "
  359.         "You will be prompted for these names now.  If you have any "
  360.         "questions as to what parameters to use, select 'help' "
  361.         "or consult information provided by your Internet provider.")
  362.  
  363.     (while
  364.         (= continue 0)
  365.  
  366.         (set
  367.  
  368.         aem-domain
  369.             (askstring
  370.                 (prompt "\nEnter the domain name for your InterNet Provider " 
  371.                         "required for getting mail\n\n")
  372.                 (help   "The domain name is usually the part of your e-mail address "
  373.                         "that follows the '@' sign.  If something else is required "
  374.                         "by your Internet Provider, provide it here.\n\n"
  375.                         "As an example, my email "
  376.                         "address is\n\njzachar@calweb.com\n\nThe domain name "
  377.                         "for my Internet provider is therefor 'calweb.com'.")
  378.                 (default aem-domain))
  379.  
  380.         aem-popserver
  381.             (if (= "" aem-domain)
  382.                 ("")
  383.                 (if (= "" aem-popserver)
  384.                     (cat "pop." aem-domain)
  385.                     (aem-popserver)))
  386.  
  387.         aem-smtpserver
  388.             (if (= "" aem-domain)
  389.                 ("")
  390.                 (if (= "" aem-smtpserver)
  391.                     (cat "smtp." aem-domain)
  392.                     (aem-smtpserver)))
  393.  
  394.         aem-popserver
  395.             (askstring
  396.                 (prompt "\nEnter the name of your POP Server\n\n")
  397.                 (help   "POP stands for 'Post Office Protocol' and your "
  398.                         "POP Server is the name assigned to the host "
  399.                         "computer that holds your Internet mail.  Normally "
  400.                         "this would be 'pop.' or 'mail.'  prepended to your "
  401.                         "Domain name.\n\n"
  402.                         "Consult your Internet provider if the POP Server "
  403.                         "is called something other than '"aem-popserver
  404.                         "' enter that name in this string requester ")
  405.                 (default aem-popserver))
  406.  
  407.         aem-smtpserver
  408.             (askstring
  409.                 (prompt "\nEnter the name of your SMTP Server\n")
  410.                 (help   "SMTP stands for 'Simple Mail Transfer Protocol' and "
  411.                         "your SMTP server is the name assigned to the host "
  412.                         "computer that sends your Internet mail.  Normally "
  413.                         "this would be 'smtp.' or 'mail.' prepended to your " 
  414.                         "Domain name.\n\n"
  415.                         "Consult your Internet provider if the SMTP Server "
  416.                         "is called something other than '"aem-smtpserver
  417.                         "' enter that name in this string requester ")
  418.                 (default aem-smtpserver))
  419.  
  420.         aem-username
  421.             (askstring
  422.                 (prompt "\nEnter the login name you have been assigned by your "
  423.                 "InterNet Provider for logging into your POP Server\n\n"
  424.                 "NOTE: Your provider may have allowed you to chose this login "
  425.                 "name.\n")
  426.                 (help "You must give your login name.  The login name consists "
  427.                 "of lowercase letters a-z and numbers.  Its recommended maximum "
  428.                 "length is 8 characters.\n\n"
  429.                 "Examples of acceptable login names are 'jzachar' and "
  430.                 "'an345'.")
  431.                 (default aem-username))
  432.  
  433.         aem-password
  434.             (askstring
  435.                 (prompt "\n\nEnter the password you need to log into your "
  436.                 "POP Server.\n\n"
  437.                 "NOTE: Your provider may have assigned you your password"
  438.                 " or you were allowed to chose your own.\n")
  439.                 (help   "This may be the same password that you use to log "
  440.                         "into your Internet Provider.  Consult your Internet "
  441.                         "Provider (ISP) if it is different.")
  442.                 (default aem-password))
  443.  
  444.  
  445.         continue
  446.             (askbool
  447.                 (prompt "Is the following information correct?\n\n"
  448.                     "SMTP Domain name: " aem-domain "\n"
  449.                     "POP Server Name: " aem-popserver "\n"
  450.                     "SMTP Server Name: " aem-smtpserver "\n"
  451.                     "Login name: " aem-username "\n"
  452.                     "Password: " aem-password "\n\n")
  453.                 (help "If you have made a mistake on any of the entries you "
  454.                 "can select \"No, Enter Again\" or, if eveything is all right, "
  455.                 "select \"Yes, Continue\"\n")
  456.                 (choices "Yes, Continue" "No, Enter Again"))
  457.         )
  458.     )
  459.  
  460.     (Set continue 0)
  461.  
  462.     (set
  463.         aem-from 
  464.             ("%s@%s" aem-username aem-domain))
  465.  
  466.     (message "\n\nWhen you signed up for your InterNet service you were "
  467.          "also assigned an email address to receive mail with.  You will "
  468.          "be prompted for this now.")
  469.  
  470.  
  471.     (while
  472.         (= continue 0)
  473.  
  474.         (set
  475.  
  476.         aem-from
  477.             (askstring
  478.                 (prompt "\n\nEnter your full email address (user@domain):\n")
  479.                 (help "You must give your email address.  The email address "
  480.                     "is what you are known by on the Internet and consists of " 
  481.                     "a username and domain name separated by an '@' sign.\n\n"
  482.                     "NOTE: The username and domain name could be the same "
  483.                     "as the POP login name and SMTP Domain Name you were "
  484.                     "prompted for before, or they MAY NOT be - consult your "
  485.                     "ISP.")
  486.                 (default aem-from))
  487.  
  488.         continue
  489.             (askbool
  490.                 (prompt "\n\nIs the following information correct?\n\n"
  491.                     "Email Address: " aem-from "\n\n")
  492.                 (help "If you have made a mistake with this entry you "
  493.                 "can select \"No, Enter Again\" or, if eveything is all right, "
  494.                 "select \"Yes, Continue\"\n")
  495.                 (choices "Yes, Continue" "No, Enter Again"))
  496.         )
  497.     )
  498.  
  499.     (Set continue 0)
  500.  
  501.     (message "\n\nThere is certain identity information that you "
  502.          "may give to further identify you on the Internet.  These include "
  503.          "your real name, a possible reply address, and the organization "
  504.          "that you belong to.  You will be prompted for these now. These are "
  505.          "all optional parameters and you can leave them blank if you wish.")
  506.  
  507.     (set aem-replyto aem-from)
  508.  
  509.     (while
  510.         (= continue 0)
  511.  
  512.         (set
  513.  
  514.         aem-realname
  515.             (askstring
  516.                 (prompt "\n\nEnter the real name for "aem-from ":\n")
  517.                 (help "The real name can contain any characters except "
  518.                     "comma (','), colon (':') or bar ('|').")
  519.                 (default aem-realname))
  520.  
  521.         aem-replyto
  522.             (askstring
  523.                 (prompt "\n\nEnter the email address you want replies "
  524.                     "sent to\n\n")
  525.                 (help   "This may be the same as your regular email address. "
  526.                         "This address is optional and can be left blank.")
  527.                 (default aem-replyto))
  528.  
  529.         aem-organization
  530.             (askstring
  531.                 (prompt "\n\nEnter the organization you belong to (optional):\n")
  532.                 (help "The organization is optional and can be left blank.")
  533.                 (default aem-organization))
  534.  
  535.         continue
  536.             (askbool
  537.                 (prompt "\n\nIs the following information correct?\n\n"
  538.                     "Real name: " aem-realname "\n"
  539.                     "Reply To Address: " aem-replyto "\n"
  540.                     "Organization: " aem-organization "\n\n")
  541.                 (help "If you have made a mistake on any of the entries you "
  542.                 "can select \"No, Enter Again\" or, if eveything is all right, "
  543.                 "select \"Yes, Continue\"\n")
  544.                 (choices "Yes, Continue" "No, Enter Again"))
  545.         )
  546.     )
  547.  
  548.     (message "\n\nAEMail requires an editor to prepare messages to send.  "
  549.         "You can use the standard AmigaDOS editor, ed, or any "
  550.         "editor of your choice.")
  551.  
  552.  
  553.     (set
  554.         aem-editor
  555.             (askfile
  556.                 (prompt "Enter the Editor you want to use with AEMail.")
  557.                 (help   "AEMail requires an editor to prepare messages to "
  558.                         "send.  After your select the editor from the file "
  559.                         "requester you will be asked to enter parameter "
  560.                         "information required by your editor.\n")
  561.                 (default "SYS:c/ed"))
  562.  
  563.         aem-editor
  564.             (askstring
  565.                 (prompt "Add the parameters required for your editor.\n\n"
  566.                         "You must always add '%s' to specify where your "
  567.                         "mail file name goes.\n")
  568.                 (help   "You will need to add parmeters that may be "
  569.                         "required by your editor.  One required parameter "
  570.                         "required by ALL editors is '%s' to specify where "
  571.                         "the mail file name goes.\n")
  572.                 (default (cat aem-editor " %s")))
  573.  
  574.         aem-edonwb
  575.             (askbool
  576.                 (prompt "Does your editor have to open on the Workbench?"
  577.                 (help   "Some editors, like Commodore's ED will always open "
  578.                         "on the Workbench.  Others will open on their own "
  579.                         "screen.  If your editor opens on the Workbench, "
  580.                         "you must reply 'YES' to this request.\n")))
  581.  
  582.         aem-editor
  583.             (if (= 1 aem-edonwb)
  584.                 (cat "WB;" aem-editor)
  585.                 ("%s" aem-editor))
  586.     )
  587.  
  588.     (set 
  589.         aem-neednetscrpts
  590.             (askbool
  591.                 (prompt "\n\nDo you want Start Net and/or Stop Net scripts?\n")
  592.                 (help   "If you reply 'Yes', you will be prompted for your "
  593.                         "Start Net and Stop Net scripts.\n"
  594.                         "If you reply 'No', AEMail will run without any "
  595.                         "Start Net or Stop Net scripts.\n")))
  596.  
  597.     (if (= 1 aem-neednetscrpts)
  598.         (if (<> "" aem-startnet)
  599.           (set aem-neednetscrpts
  600.             (askbool
  601.                 (prompt "Is your StartNet and/or StopNet scripts other than\n\n"
  602.                         "Start Net: " aem-startnet "\n"
  603.                         "Stop Net:  " aem-stopnet  "\n")
  604.                 (help   "Only reply 'YES' if your Start Net and Stop Net scripts "
  605.                         "are not the scripts listed listed below:\n\n"
  606.                          aem-startnet "\n"
  607.                          aem-stopnet "\n"))))
  608.         (set
  609.             aem-needstrtarexx 0
  610.             aem-startnet ""
  611.             aem-needstoparexx 0
  612.             aem-stopnet ""))
  613.  
  614.  
  615.     (if (= 1 aem-neednetscrpts)
  616.         ((set
  617.           need-startnet
  618.             (askbool
  619.                 (prompt "Do you need a Start Net script?")
  620.                 (help   "If you reply 'No' AEMail will run without a Start Net "
  621.                         "script\n\nIf you reply 'YES' you will be prompted "
  622.                         "for the location of your Start Net script")))
  623.         (if (= 1 need-startnet)
  624.              (set
  625.                aem-startnet
  626.                 (askfile
  627.                   (prompt "Enter the Start Net script you want to use with AEMail.")
  628.                   (help   "If you are NOT using the standard AmiTCP startnet "
  629.                           "script in AmiTCP:bin or the standard Miami script "
  630.                           "you will have to provide the "
  631.                           "script you are using.\n")
  632.                   (default (tackon aem-default-dest "startnet")))
  633.                aem-needstrtarexx
  634.                 (askbool
  635.                     (prompt "Is this an AmigaDOS script or an AREXX script?")
  636.                     (help   "The standard AmiTCP Start Net script is an AmigaDos "
  637.                             "script that calls AREXX\n\n "
  638.                             "The standard Miami script is an AREXX script "
  639.                             "AND must be called from AREXX\n")
  640.                     (choices "AREXX script" "AmigaDOS script")))
  641.              (set aem-startnet ""
  642.                   aem-needstrtarexx 0))
  643.  
  644.         (set
  645.           need-stopnet
  646.             (askbool
  647.                 (prompt "Do you need a Stop Net script?")
  648.                 (help   "If you reply 'No' AEMail will run without a Stop Net "
  649.                         "script\n\nIf you reply 'YES' you will be prompted "
  650.                         "for the location of your Stop Net script")))
  651.         (if (= 1 need-stopnet)
  652.             (set
  653.                aem-stopnet
  654.                 (askfile
  655.                   (prompt "Enter the Stop Net script you want to use with AEMail.")
  656.                   (help   "If you are NOT using the standard AmiTCP stopnet "
  657.                           "script in AmiTCP:bin or the standard Miami script "
  658.                           "you will have to provide the "
  659.                           "script you are using.\n")
  660.                   (default (tackon aem-default-dest "stopnet")))
  661.                aem-needstoparexx
  662.                 (askbool
  663.                     (prompt "Is this an AmigaDOS script or an AREXX script?")
  664.                     (help   "The standard AmiTCP Stop Net script is an AmigaDos "
  665.                             "script that calls AREXX\n\n "
  666.                             "The standard Miami script is an AREXX script "
  667.                             "AND must be called from AREXX\n")
  668.                     (choices "AREXX script" "AmigaDOS script")))
  669.              (set aem-stopnet ""
  670.                   aem-needstoparexx 0))))
  671.  
  672.     (set aem-options
  673.         (askoptions
  674.             (prompt "Select those AEMail options you want AEMail to open with\n\n")
  675.             (help @askoptions-help)
  676.             (choices "Delete Mail from Server"
  677.                  "Strip Duplicate Messages"
  678.                  "Display Full Header"
  679.                  "Include Header in Reply"
  680.                  "Automatic Connection at Startup"
  681.                  )
  682.             (default 3))
  683.     )))
  684.  
  685.  
  686. (if (= 1 aem-needstrtarexx)
  687.     (set
  688.         aem-startnet
  689.             (cat "rx " aem-startnet)))
  690.  
  691. (if (= 1 aem-needstoparexx)
  692.     (set
  693.         aem-stopnet
  694.             (cat "rx " aem-stopnet)))
  695.  
  696. (if (= 2 @user-level)
  697.     (set
  698.       aem-needconfig
  699.         (askbool
  700.             (prompt "Do you want to run with your own configuration file?")
  701.             (help   "If you are using the standard s:aemail.cnfg file "
  702.                     "reply 'NO'.\n\n"
  703.                     "If you want to use your own configuration file then "
  704.                     "reply 'YES'")))
  705.     (set aem-needconfig 0))
  706.  
  707. (if (= 1 aem-needconfig)
  708.     (set
  709.         aem-config
  710.             (askfile
  711.                 (prompt "Enter the configuration script you want to use "
  712.                         "with AEMail")
  713.                 (help   "If you are using a configuration file other than "
  714.                         "s:aemail.cnfg you can locate and or specify it "
  715.                         "here.")
  716.                 (default "s:aemail.cnfg"))))
  717.  
  718. (set
  719.     aem-docs-dir-dft (tackon @default-dest "documentation"))
  720.  
  721. (if (< 0 @user-level)
  722.     (set
  723.       aem-docs
  724.         (askoptions
  725.             (prompt "Select which AEMail documentation files you want copied\n\n")
  726.             (help @askoptions-help)
  727.             (choices "AEMail.readme"
  728.                      "AEMail.doc"
  729.                      "AEMail.guide"
  730.                      "email.txt"
  731.                      )
  732.             (default 15)))
  733.  
  734.     (set aem-docs 15))
  735.  
  736.  
  737. (if (= 2 @user-level)
  738.     (if (<> 0 aem-docs)
  739.         (set
  740.           aem-docs-dir
  741.             (askdir
  742.                 (prompt "Which directory do you want the documentation files "
  743.                         "copied to\n")
  744.                 (help   "You may select a different directory than the " 
  745.                         "'documentation' sub-directory in your program's "
  746.                         "directory to copy the documentation files to.\n")
  747.                 (newpath)
  748.                 (default aem-docs-dir-dft))))
  749.     (set aem-docs-dir aem-docs-dir-dft)
  750. )
  751.  
  752. (if (<> 2 (exists aem-mail-dir (noreq)))
  753.     (makedir aem-mail-dir (infos)))
  754.  
  755. (if (<> 2 (exists aem-docs-dir (noreq)))
  756.     (makedir aem-docs-dir (infos)))
  757.  
  758. (copyfiles
  759.     (prompt "Copying AEMail to " @default-dest)
  760.     (source "RAM:AEMfiles/AEMail")
  761.     (dest   @default-dest))
  762.  
  763. (copyfiles
  764.     (prompt "Copying AEMail.info to " @default-dest)
  765.     (source "RAM:AEMfiles/AEMail.inf")
  766.     (newname "AEMail.info")
  767.     (dest   @default-dest)
  768.     (noposition))
  769.  
  770. (copyfiles
  771.     (prompt "copy registration.form to " @default-dest)
  772.     (source (tackon source-dir "registration.form"))
  773.     (dest   @default-dest)
  774.     (noposition)
  775.     (infos))
  776.  
  777. (if (= 1 aem-have-MIAMI)
  778.     ((copyfiles
  779.         (prompt "Copy Miami Start Net script to " @default-dest)
  780.         (source (tackon source-dir "startnet.miami"))
  781.         (dest   @default-dest))
  782.     (copyfiles
  783.         (prompt "Copy Miami Stop Net script to " @default-dest)
  784.         (source (tackon source-dir "stopnet.miami"))
  785.         (dest   @default-dest))))
  786.  
  787. (if (= 1 (exists (tackon @default-dest "AEMail.readme") (noreq)))
  788.     (delete (tackon @default-dest "AEMail.readme")
  789.         (prompt "Deleting old AEMail.readme file")
  790.         (infos)))
  791.  
  792. (if (= 1 (exists (tackon aem-docs-dir "AEMail.readme") (noreq)))
  793.     (delete (tackon aem-docs-dir "AEMail.readme")
  794.         (prompt "Deleting old AEMail.readme file")
  795.         (infos)))
  796.  
  797. (if (= 1 (exists (tackon @default-dest "AEMail.doc") (noreq)))
  798.     (delete (tackon @default-dest "AEMail.doc")
  799.         (prompt "Deleting old AEMail.doc file")
  800.         (infos)))
  801.  
  802. (if (= 1 (exists (tackon @default-dest "AEMail.guide") (noreq)))
  803.     (delete (tackon @default-dest "AEMail.guide")
  804.         (prompt "Deleting old AEMail.guide file")
  805.         (infos)))
  806.  
  807. (set aem-readtool
  808.     (if (= pager-cmd "RAM:More")
  809.         ("more")
  810.         (pager-cmd)))
  811.  
  812.  
  813. (if (<> 0 aem-docs)(
  814.     (if (BITAND aem-docs 1)
  815.         ((copyfiles
  816.             (prompt "Copying AEMail.readme file to " @default-dest)
  817.             (source "RAM:AEMfiles/AEMail.readme")
  818.             (dest   @default-dest)
  819.             (infos))
  820.         (tooltype
  821.             (dest (tackon @default-dest "AEMail.readme"))
  822.             (noposition)
  823.             (setdefaulttool aem-readtool))))       
  824.  
  825.     (if (BITAND aem-docs 2)
  826.         ((copyfiles
  827.             (prompt "Copying AEMail.doc file to " aem-docs-dir)
  828.             (source "RAM:AEMfiles/AEMail.doc")
  829.             (dest   aem-docs-dir)
  830.             (infos))
  831.         (tooltype
  832.             (dest (tackon aem-docs-dir "AEMail.doc"))
  833.             (noposition)
  834.             (setdefaulttool "more"))))       
  835.  
  836.     (if (BITAND aem-docs 4)
  837.         ((copyfiles
  838.             (prompt "Copying AEMail.guide file to " aem-docs-dir)
  839.             (source "RAM:AEMfiles/AEMail.guide")
  840.             (dest   aem-docs-dir)
  841.             (infos))
  842.         (tooltype
  843.             (dest (tackon aem-docs-dir "AEMail.guide"))
  844.             (noposition))))
  845.  
  846.     (if (BITAND aem-docs 8)
  847.         ((copyfiles
  848.             (prompt "Copying email.txt file to " aem-docs-dir)
  849.             (source "RAM:AEMfiles/email.txt")
  850.             (dest   aem-docs-dir)
  851.             (infos))
  852.         (tooltype
  853.             (dest (tackon aem-docs-dir "email.txt"))
  854.             (noposition)
  855.             (setdefaulttool "more"))))       
  856.  
  857. ))
  858.  
  859. (tooltype
  860.     (prompt "Setting AEMail Tool Types")
  861.     (dest (tackon @default-dest "AEMail"))
  862.     (if (<> "" aem-config)
  863.         (settooltype "CONFIG" aem-config))
  864.     (if (= 1 aem-interlace)
  865.         (settooltype "INTERLACE" "YES"))
  866.     (if (<> "" aem-username)
  867.         (settooltype "USERID" aem-username))
  868.     (if (<> "" aem-password)
  869.         (settooltype "PASSWRD" aem-password))
  870.     (if (<> "" aem-realname)
  871.         (settooltype "REALNAME" aem-realname))
  872.     (if (<> "" aem-from)
  873.         (settooltype "FROM" aem-from))
  874.     (if (<> "" aem-replyto)
  875.         (settooltype "REPLYTO" aem-replyto))
  876.     (if (<> "" aem-organization)
  877.         (settooltype "ORGANIZATION" aem-organization))
  878.     (if (<> "" aem-domain)
  879.         (settooltype "DOMAIN" aem-domain))
  880.     (if (<> "" aem-popserver)
  881.         (settooltype "POP_SERVER" aem-popserver))
  882.     (if (<> "" aem-smtpserver)
  883.         (settooltype "SMTP_SERVER" aem-smtpserver))
  884.     (if (<> "" aem-editor)
  885.         (settooltype "EDITOR" ("\"%s\"" aem-editor)))
  886.     (if (<> "" aem-startnet)
  887.         (settooltype "STARTNET" aem-startnet))
  888.     (if (<> "" aem-stopnet)
  889.         (settooltype "STOPNET" aem-stopnet))
  890.     (if (BITAND aem-options 1)
  891.         (settooltype "DELETEMAIL" "YES"))
  892.     (if (BITAND aem-options 2)
  893.         (settooltype "STRIPDUPS" "YES"))
  894.     (if (BITAND aem-options 4)
  895.         (settooltype "FULLHEADER" "YES"))
  896.     (if (BITAND aem-options 8)
  897.         (settooltype "HDRINREPLY" "YES"))
  898.     (if (BITAND aem-options 16)
  899.         (settooltype "AUTOCONNECT" "YES"))
  900. )
  901.  
  902. (procedure aemp-build_mailcap
  903.  
  904.     ((set
  905.         aem-mimetypes
  906.             (askoptions
  907.                 (prompt "Indicate those mime types/subtypes you want "
  908.                         "display programs for")
  909.                 (help   "Check which types/subtypes that you will specify "
  910.                         "a display program for.  If you specify the type/all "
  911.                         "option you must have a program that can determine "
  912.                         "the appropriate display subtype")
  913.                 (choices    "text/all"
  914.                             "images/all"
  915.                             "images/gif"
  916.                             "images/jpeg"
  917.                             "images/x-iff"
  918.                             "audio/all"
  919.                             "audio/basic"
  920.                             "video/all"
  921.                             "video/mpeg"))
  922.  
  923.         aem-curmailcap 0)
  924.  
  925.     (delete aem-mailcap_file)
  926.  
  927.     (while (<> 0 aem-mimetypes)
  928.         ((if (BITAND aem-mimetypes 1)
  929.             ((set
  930.                 aem-curmimet
  931.                     (select aem-curmailcap "text/*"
  932.                                            "images/*"
  933.                                            "images/gif"
  934.                                            "images/jpeg"
  935.                                            "images/x-iff"
  936.                                            "audio/*"
  937.                                            "audio/basic"
  938.                                            "video/*"
  939.                                            "video/mpeg")
  940.  
  941.                 aem-mimefile
  942.                     (askfile
  943.                         (prompt "Indicate program to display " aem-curmimet)
  944.                         (help   "Select the program in the file list that will "
  945.                                 "be used the display the file described by the "
  946.                                 "indicated mime type/subtype")
  947.                         (default ""))
  948.  
  949.                 aem-mimefile
  950.                     (askstring
  951.                         (prompt "Add the parameters required for the mime "
  952.                                 "display program you selected\n\n"
  953.                                 "You must always add '%s' to specify where "
  954.                                 "the file you are displaying goes.\n")
  955.                         (help   "You will need to add parmeters that may be "
  956.                                 "required by the display program that you "
  957.                                 "specified.  One required parameter required "
  958.                                 "by ALL programs is '%s' to specify where "
  959.                                 "the file name for the file you are "
  960.                                 "displaying goes.\n")
  961.                         (default (cat aem-mimefile " %s")))
  962.  
  963.                 aem-mimeonwb
  964.                     (askbool
  965.                         (prompt "Does the mime display program have to open "
  966.                                 "on the Workbench?"
  967.                         (help   "Some programs will always open on the "
  968.                                 "Workbench.  Others will open on their own "
  969.                                 "screen.  If your display program opens on "
  970.                                 "the Workbench, you must reply 'YES' to this "
  971.                                 "request.\n")))
  972.  
  973.                 aem-mimefile
  974.                     (if (= 1 aem-mimeonwb)
  975.                         (cat "WB;" aem-mimefile)
  976.                         ("%s" aem-mimefile)))
  977.  
  978.             (textfile
  979.                 (prompt "Creating .mailcap file")
  980.                 (help   "Creating .mailcap file")
  981.                 (dest   aem-mailcap_file)
  982.                 (include aem-mailcap_file)
  983.                 (append ("%s; \"%s\"\n" aem-curmimet aem-mimefile)))))
  984.         (set aem-curmailcap (+ 1 aem-curmailcap))
  985.         (set aem-mimetypes (shiftright aem-mimetypes 1))
  986.  
  987.     )))
  988. )
  989.  
  990. (set aem-existmailcap 0)
  991.  
  992. (if (= 2 @user-level)
  993.     (set aem-existmailcap
  994.         (askbool
  995.             (prompt "\nDo you want to use an existing mailcap file used by "
  996.                     "another program?\n\nIf you want to use the default "
  997.                     "mailcap file that comes with AEMail, reply 'NO' to this "
  998.                     "message.")
  999.             (help   "AEMail can run with a mailcap file created for another "
  1000.                     "program.  If you reply 'YES' to this message you will "
  1001.                     "be prompted for the directory containing your mailcap "
  1002.                     "file and the MAILCAP= tool type will be set up in you "
  1003.                     "AEMail icon"))))
  1004.  
  1005. (if (= 1 aem-existmailcap)
  1006.     ((set aem-mailcapdir
  1007.         (askdir
  1008.             (prompt "Enter the drawer that contains your mailcap file")
  1009.             (help   "AEMail can run with a mailcap file created for another "
  1010.                     "program.  Enter the directory that contains the mailcap "
  1011.                     "file that you want and the MAILCAP= tool type will be set "
  1012.                     "up in you AEMail icon")
  1013.             (default aem-mail-dir)
  1014.             (newpath)))
  1015.     (if (= 1 (exists (tackon aem-mailcapdir "mailcap")(noreq)))
  1016.         (tooltype
  1017.             (prompt "Setting AEMail Tool Types")
  1018.             (dest (tackon @default-dest "AEMail"))
  1019.             (settooltype "MAILCAP_DIR" aem-mailcapdir))
  1020.         (message "A mailcap file does not exist in the directory you have "
  1021.                  "specified. Continuing assuming no existing mailcap file."))))
  1022.  
  1023. (if (< exec-version version_3_0)
  1024.     (if (= 2 @user-level)
  1025.         ((set
  1026.             aem-createmailcap
  1027.             (askbool
  1028.                 (prompt "\nYou are running under AmigaDos 2.1.  Do you want "
  1029.                     "to create your own mailcap file?\n")
  1030.                 (help   "AEMail is configured either by Tool Types in it's icon "
  1031.                     "or by a configuration screen which is automatically "
  1032.                     "called up when you first execute AEMail if the Tool "
  1033.                     "Type parameters were not given.  By replying "
  1034.                     "'Yes, Configure Now' you will be setting the Tool Type "
  1035.                     "parameters\n"))
  1036.             aem-mailcap_file (tackon aem-mail-dir "mailcap"))
  1037.         (if (= 1 aem-createmailcap)
  1038.             (aemp-build_mailcap))))
  1039.     (copyfiles
  1040.         (prompt "Copying mailcap to " aem-mail-dir)
  1041.         (source (tackon source-dir "mailcap"))
  1042.         (dest   aem-mail-dir))
  1043. )
  1044.  
  1045. (textfile
  1046.     (prompt "Creating ENV:AEMail_Dir")
  1047.     (help "Creating ENV:AEMail_Dir")
  1048.     (dest "ENV:AEMail_Dir")
  1049.     (append @default-dest))
  1050.  
  1051. (textfile
  1052.     (prompt "Creating ENVARC:AEMail_Dir")
  1053.     (help "Creating ENVARC:AEMail_Dir")
  1054.     (dest "ENVARC:AEMail_Dir")
  1055.     (append @default-dest))
  1056.  
  1057.  
  1058. (startup
  1059.     aem-name
  1060.         (prompt "Adding AEMAIL assign to S:User-Startup")
  1061.         (help   "An ASSIGN statement for AEMAIL will now be added to the S:User-Startup")
  1062.         (command ("ASSIGN %s \"%s\"\n" aem-assign aem-mail-dir))
  1063.         (command ("ASSIGN C: sys:REXXC ADD")))
  1064.  
  1065. (makeassign aem-name aem-mail-dir)
  1066.  
  1067. (set aem-copyold 0)
  1068. (if (= 1 (exists "AEMail:folder.config" (noreq)))
  1069.     (set aem-copyold
  1070.         (askbool
  1071.             (prompt "You have an existing folder.config file\n\n"
  1072.                 "Do you want to save this file as folder.config.old?\n")
  1073.             (help "If you are installing over a version of AEMail prior to "
  1074.                 "Version 1.40 you should reply YES to this prompt\n\n"
  1075.                 "If you reinstall a version earlier than 1.40 you should "
  1076.                 "rename folder.config.old to folder.config\n")
  1077.             (choices "Yes, save folder.config" "No, Ignore"))))
  1078.  
  1079. (if (= 1 aem-copyold)
  1080.     (copyfiles
  1081.         (prompt "Copying folder.config to folder.config.old")
  1082.         (source "AEMail:folder.config")
  1083.         (newname "folder.config.old")
  1084.         (dest "AEMail:")))
  1085.  
  1086. (set continue 0
  1087.      aem-regkey ""
  1088.      aem-regname aem-realname
  1089.      aem-aemr (tackon source-dir "AEMR"))
  1090.  
  1091. (if (= 1 (exists aem-aemr (noreq)))
  1092.  
  1093.     (while
  1094.         (= continue 0)
  1095.  
  1096.         (set
  1097.             aem-regkey
  1098.                 (askstring
  1099.                     (prompt "You are installing a registered version of "
  1100.                             "AEMail.\n\n"
  1101.                             "Please enter the key code provided with your "
  1102.                             "copy of AEMail.")
  1103.                     (help   "You must enter your key code EXACTLY as provided "
  1104.                             "using the correct upper and lower cas letters.")
  1105.                     (default aem-regkey))
  1106.  
  1107.             aem-regname
  1108.                 (askstring
  1109.                     (prompt "Please enter the name you want AEMail registered "
  1110.                             "under:")
  1111.                     (help   "You must enter a registered name\n\n"
  1112.                             "If you entered a 'real name' under the "
  1113.                             "configuration previously, it will be the default "
  1114.                             "registration name.  You can make any changes to ")
  1115.                     (default aem-regname))
  1116.  
  1117.             aem-regserno
  1118.                 (run aem-aemr aem-regkey "\""aem-regname"\""))
  1119.  
  1120.         (if (> 100 aem-regserno)
  1121.             ((if (= 1 aem-regserno)
  1122.                 ((message "You did not enter either a key or registration "
  1123.                          "name\n\nTry Again!")
  1124.                 (set continue 0)))
  1125.             (if (= 2 aem-regserno)
  1126.                 ((message "You entered an incorrect key code\n\nTry Again!")
  1127.                  (set continue 0)))
  1128.             (if (= 50 aem-regserno)
  1129.                 ((message "Failed to create .registration file\n\n"
  1130.                           "AEMail: is probably not assigned.\n\n"
  1131.                           "Continuing as an unregistered version.  Contact "
  1132.                           "jzachar@calweb.com for further instructions.")
  1133.                  (set continue 1))))
  1134.             (set continue
  1135.                 (askbool
  1136.                     (prompt "\nIs the following information correct?\n\n"
  1137.                             "registration name: " aem-regname "\n"
  1138.                             "    serial number: " aem-regserno "\n\n"
  1139.                             "If not, you can repeat the registration process")
  1140.  
  1141.                     (help   "Check the serial number with the number on the "
  1142.                             "provided information sheet.  If it or your "
  1143.                             "registration name or incorrect you can select "
  1144.                             "\"No, Enter Again\" or, if everything is all "
  1145.                             "right, select \"Yes, Repeat Registration\"\n")
  1146.                     (choices "Yes, Continue" "No, Repeat Registration"))))))
  1147.  
  1148.  
  1149. (message
  1150.     "\n\nThe installation of AEMail is now complete.  You can execute AEMail "
  1151.     "now by double clicking on it's icon without rebooting your system."
  1152.     "  The AEMAIL: assignment has been made and also has been placed in your "
  1153.     "S:User-Startup file.  Please read the AEMail.Readme file before "
  1154.     "executing AEMail.")
  1155.  
  1156. (set AEM-End
  1157.     (run pager-cmd "RAM:AEMfiles/AEMail.Readme" (safe)))
  1158.  
  1159. (delete
  1160.     "RAM:AEMfiles"
  1161.     (prompt "Deleting RAM: AEMail files")
  1162.     (optional "force")
  1163.     (safe)
  1164.     (infos)
  1165.     (all))
  1166.  
  1167. (exit)
  1168.  
  1169.